package co.edu.unal.bioingenium.kbmed.mapping.services.impl;

import java.util.LinkedList;

/**
 *
 * @author Alejandro
 */
public class MappingQueue {

    private LinkedList<String> queue;

    /**
     * 
     */
    public MappingQueue() {
        queue = new LinkedList<String>();
    }

    /**
     * 
     * @param key
     */
    public void put(String key) {
        queue.addLast(key);
    }

    /**
     * 
     * @return
     */
    public String get() {
        if (queue.isEmpty()) {
            return null;
        }
        return queue.removeFirst();
    }

    /**
     * 
     * @return
     */
    public String peek() {
        return queue.getFirst();
    }

    /**
     * 
     * @return
     */
    public boolean isEmpty() {
        return queue.isEmpty();
    }

    /**
     * 
     * @return
     */
    public int size() {
        return queue.size();
    }
}
